// 懒加载
import { lazy } from 'react'

interface Router {
  name?: string,// 可以没有 有就必须为字符串
  path: string,
  meta?: object,
  children?: Array<Router>,
  component: any
}

// 路由配置表
//const routeList: Array<Router> = [
const routeList: Array<Router> = [
  {
    path: '/',
    component: lazy(() => import('../pages/Home'))
  },
  {
    path: 'home',
    meta: {
      title: '首页',
    },
    children: [
      {
        path: 'cityList',
        meta: {
          title: '首页-二级路由',
        },
        children: [
          {
            path: 'test',
            meta: {
              title: '首页-三级路由',
            },
            component: lazy(() => import('../pages/Test'))
          }
        ],
        component: lazy(() => import('../pages/TestTwo'))
      }
    ],
    component: lazy(() => import('../pages/Home'))
  },
  {
    path: '/todo',
    meta: {
      title: '我的代办',
    },
    component: lazy(() => import('../pages/Todo'))
  },
  {
    path: '/news',
    meta: {
      title: '消息',
    },
    component: lazy(() => import('../pages/News'))
  },
  {
    path: '/me',
    meta: {
      title: '我的',
    },
    component: lazy(() => import('../pages/Me'))
  },
  {
    path: '/map',
    meta: {
      title: '地图找房',
    },
    component: lazy(() => import('../pages/Map'))
  },
  {
    path: '/cityList',
    meta: {
      title: '城市列表',
    },
    component: lazy(() => import('../pages/CityList'))
  },
  
]

export default routeList